package com.molichuxing.services.business.service;

import java.util.List;
import java.util.Map;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.business.dto.request.create.GoodsExclusiveCreateDto;
import com.molichuxing.services.business.dto.request.create.GoodsSubscribeCreateDto;
import com.molichuxing.services.business.dto.response.*;
import com.molichuxing.services.infrastructure.dto.response.GoodsDto;
import com.molichuxing.services.property.GoodsForbidSaleEnum;
import com.molichuxing.services.property.GoodsMileageSubscribeEnum;
import com.molichuxing.services.property.GoodsTypeEnum;

/**
 * @create_date: 2019/4/3
 * @name:goods-service
 * @author xuelin yi
 **/
public interface GoodsBizService extends RootService {

    /**
     * 获取商品信息列表
     * @param goodsTypeEnum
     * @param code
     * @param carStyleId
     * @param dealerId
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<GoodsBizBizDto> getGoodsList(GoodsTypeEnum goodsTypeEnum, String code, Integer carStyleId, Integer dealerId, int pageNum, int pageSize);


    /**
     * 根据经销商ID获取商品信息列表
     * @param dealerId
     * @param goodsTypeEnum
     * @param carStyleId
     * @return
     */
    public List<GoodsBizBizDto> getDealerGoodsList(Integer dealerId, GoodsTypeEnum goodsTypeEnum, Integer carStyleId);

    /**
     * 获取商品基础信息
     * @param goodsId
     * @return
     */
    public GoodsBaseBizDto getBaseGoods(Integer goodsId) throws Exception;


    /**
     * 根据商品id判断商品是否禁售
     * @param goodsId
     * @param dealerId
     * @return
     * @throws Exception
     */
    public Boolean isProhibited(Integer goodsId, Integer dealerId) throws Exception;

    /**
     * 获取商品详细信息
     * @param goodsId
     * @return
     */
    public GoodsDetailBizDto getDetailGoods(Integer goodsId)throws Exception ;

    /**
     * 新增专属商品信息列表
     * @param createDto
     * @return
     * @throws Exception
     */
    public Boolean createExclusiveGoods(GoodsExclusiveCreateDto createDto) throws Exception;

    /**
     * 新增订阅商品信息列表
     * @param createDto
     * @return
     * @throws Exception
     */
    public Boolean createSubscribeGoods(GoodsSubscribeCreateDto createDto) throws Exception;

    /**
     * 设置商品禁售状态
     * @param goodsId
     * @param goodsForbidSaleEnum
     * @return
     * @throws Exception
     */
    public Boolean settingGoodsSale(int goodsId, GoodsForbidSaleEnum goodsForbidSaleEnum) throws Exception;

    /**
     * 设置商品禁售状态
     * @param dealerId
     * @param goodsForbidSaleEnum
     * @return
     * @throws Exception
     */
    public Boolean settingGoodsSaleByDealer(Integer dealerId, GoodsForbidSaleEnum goodsForbidSaleEnum) throws Exception;


    /**
     * 根据经销商id查询分销的商品
     * @param dealerIds
     * @return
     */
    public Map<Integer, List<GoodsDto>> getGoodsListByDealerIds(List<Integer> dealerIds);


    /******************************* APP接口  ***********************************************/
    /**
     * 根据经销商ID获取商品信息列表
     * @param dealerId
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Deprecated
    public Paged<GoodsBizBizDto> getAppGoodsList(Integer dealerId, Integer pageNum, Integer pageSize);

    /**
     * 根据经销商ID获取商品信息列表
     * @param dealerId
     * @param selectParam  goodsType 1:专属，2：订阅  startBudget :开始预算   endBudget :结束预算  startTime :开始时间   endTime :结束时间
     * @param sortFlag 1：全部车型，2：帮您选车，3：日常代步，4：热销车型，5：产品列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<GoodsBizBizDto> getAppGoodsListNew(Integer dealerId, Map<String, Object> selectParam,Integer sortFlag, Integer pageNum, Integer pageSize);

    /**
     * 根据商品id集合获取商品信息列表
     * @param goodsIds
     * @return
     */
    public List<GoodsBizBizDto> getAppGoodsByIds(List<Integer> goodsIds);

    /**
     * 获取商品详细信息
     * @param goodsId
     * @return
     */
    public GoodsOrderBizDto getGoodsForOrder(Integer goodsId, Integer packageId)throws Exception;

    /**
     * 获取专属商品的抽屉信息
     * @param goodsId
     * @return
     * @throws Exception
     */
    public GoodsExclusiveDrawerBizDto getAppExclusiveGoods(Integer goodsId, Integer dealerId) throws Exception;


    /**
     * 获取订阅商品的抽屉信息
     * @param goodsId
     * @return
     * @throws Exception
     */
    public GoodsSubscribeDrawerBizDto getAppSubscribeGoods(Integer goodsId, Integer packageId, Integer dealerId) throws Exception;

    /**
     * 根据商品id查询里程包商品信息
     * @param goodsId
     * @return
     * @throws Exception
     */
    public List<GoodsReletMileageBizDto> getGoodsMileage(Integer goodsId, Integer dealerId) throws Exception;


    /**
     * 根据商品id查询加购的商品信息
     * @param goodsId
     * @param goodsMileageSubscribeEnum
     * @return
     * @throws Exception
     */
	public List<GoodsMileagePackageReletBizDto> getGoodsMileagePackage(Integer goodsId, Integer dealerId, GoodsMileageSubscribeEnum goodsMileageSubscribeEnum) throws Exception;

    /**
     * 根据经销商id获取车型
     * @param dealerId
     * @return
     */
	public List<Integer> getModelIdByDealerId(Integer dealerId);

    /**
     * 根据经销商ID获取大屏商品信息列表
     * @param dealerId
     * @param vehicleIds
     * @return
     */
    public List<GoodsBigScreenBizDto> getBigScreenGoodsList(Integer dealerId, List<Integer> vehicleIds);
}
